package com.hangxin.commons.util.resource;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;







public class ReadResource {
	static final Logger logger = LoggerFactory
	.getLogger(ReadResource.class);
	private static Properties p = new Properties();
	static {
		init();
	}

	private static void init() {	
		InputStream in = ReadResource.class.getClassLoader().getResourceAsStream("config.properties");
		try {
			p.load(in);
		} catch (IOException e) {
			logger.error("读取配置文件出错",e);
		}					
	}
	public static String getResource(String name)
	{
		return p.getProperty(name);
	}
}
